#include <stdio.h>
int main()
{
    int a[10];
    for ( int i = 0; i < 10; i++ ) {
        scanf("%d", &a[i]);
    }
     
    int b = 0, cnt = 0;
    scanf("%d", &b);
    for ( int i = 0; i < 10; i++ ) {
        if ( a[i] <= b + 30 ) {
            cnt ++;
        }
    }
    printf("%d", cnt);
    return 0;
} 
